<?php if(!empty($post->previous)) echo "<a href=\"".$post->previous->url."\">&lt;上一张</a>"; ?>
<?php if(!empty($post->previous) && !empty($post->next)) echo " | "; ?>
<?php if(!empty($post->next)) echo "<a href=\"".$post->next->url."\">下一张&gt;</a>"; ?>
<br/>
<?php 
if(!empty($post->file)) {
	$file = $post->file;
	$pi = pathinfo($file);
	$path = $this->setting->upload_url_path . '/' . $pi['dirname'] . '/';
	$file = $pi['basename'];
	$vs = array();
	if(isset($post->meta) && isset($post->meta['sizes'])){
		//array_key_exists
		$defv = $this->get('view','thumbnail');
		$defv = array_key_exists($defv, (array)$post->meta['sizes']) ? $defv : 'thumbnail';
		if(isset($post->meta['sizes'][$defv])) {
			$file = $post->meta['sizes'][$defv]['file'];
		}
		foreach ($post->meta['sizes'] AS $key => $img){
			if($defv==$key){
				$vs[] = $img['width'].'x'.$img['height'];
			} else {
				$vs[] = '<a href="?view='.$key.'">'.$img['width'].'x'.$img['height'].'</a>';
			}
		}
	}
	echo '<img border="0" src="'.$path . $file.'" />'."<br/>\n";
	echo implode('.', $vs);
} else {
	echo "该图片无法查看，或者已经被删除了！";
}
?><br/><a href="<?php echo $path . $file; ?>">下载当前图片到手机&gt;&gt;</a>
<br/><a href="<?php echo $this->setting->upload_url_path.'/'.$post->meta['file']; ?>">下载原图到手机(<?php echo $post->meta['width'].'x'.$post->meta['height'];?>)&gt;&gt;</a>
<br/><?php
if(!empty($post->ptitle)) {
	echo '<a href="'.$this->url('post', $post->parent).'">&lt;&lt;返回到文章《'.$post->ptitle.'》</a>';
}
?><br/>
<?php echo $post->content;?>
